package com.copy.pojo;

import java.lang.reflect.Method;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
 * author: liziyun
 * date: 2019-9-30
 * email: root@ofo.email
 * describe: 接口元数据信息
 *
 */
public class BeanMetaData {
    protected Class cls;
    private String name;//别名
    //接口类的字节码
    private Map<Method, BeanMethod> beanMethodMaping = new ConcurrentHashMap<>();
    public BeanMetaData(String name, Class cls) {
        this.name = name;
        this.cls = cls;
    }
    public void addBeanMethods(Method method,BeanMethod beanMethod){
        beanMethodMaping.put(method, beanMethod);
    }
    public Map<Method, BeanMethod>  getBeanMethods(){
        return beanMethodMaping ;//安全的对外发布
    }
    public BeanMethod getBeanMethod(Method method){
        return beanMethodMaping.get(method);
    }

    public Class getCls() {
        return cls;
    }

    public void setCls(Class cls) {
        this.cls = cls;
    }
    public String getName() {
        return name;
    }
}
